home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / System / ABackup / Installation / Install_ABackup < prev    next >
Text File  |  1999-08-21  |  15KB  |  388 lines

  1. ;
  2. ; Installer script for ABackup installation
  3. ; $VER: Install_ABackup v36.4 (21.8.99)
  4. ;
  5. ;********* Initialisations ****************************************************
  6. ;
  7. (set MainDir            "")
  8. (set PrefDir            "")
  9. (set DefPrefDir         "SYS:Prefs")
  10. (set SourceDir          "/")
  11. (set XPKSourceDir       (tackon SourceDir "libs/compressors"))
  12. (set TmpFile            (cat "T:RunABPrefs_" (database "total-mem")))
  13. ;
  14. ;********* Setup all the messages *********************************************
  15. ;
  16. (procedure SetupMessages (
  17.   (set DefHelpDir       (tackon "HELP:" @language))
  18.   (set DefCatalogDir    (tackon "LOCALE:Catalogs" @language))
  19.  
  20.   (if (= @language "english")
  21.     (
  22.       (set #InstallWhat         "What do you want to install ?")
  23.       (set #InstallChoice1      "Main program")
  24.       (set #InstallChoice2      "Preferences program")
  25.       (set #InstallChoice3      "Online help")
  26.       (set #InstallChoice4      "XPK libraries")
  27.       (set #InstallChoice5      "")
  28.       (set #SelectMainDir       "Select the directory where to copy the Main program.")
  29.       (set #CopyingMainProg     "Copying the Main program...")
  30.       (set #SelectPrefDir       "Select the directory where to copy the Prefs program.")
  31.       (set #BadPrefDir          "Sorry, the Main program and the Prefs program can't be installed in the same directory !")
  32.       (set #CopyingPrefProg     "Copying the Prefs program...")
  33.       (set #UpdateMainTT1       "Updating the %s tooltype of the Main program...")
  34.       (set #UpdateMainTT2       "Don't forget to update the %s tooltype of the Main program.")
  35.       (set #UpdateMainTTH1      "This will allow the Main program to call the Prefs program.")
  36.       (set #UpdateMainTTH2      "This will allow the Main program to find the help file.")
  37.       (set #UpdatePrefTT1       "Updating the %s tooltype of the Prefs program...")
  38.       (set #UpdatePrefTT2       "Don't forget to update the %s tooltype of the Prefs program.")
  39.       (set #UpdatePrefTTH2      "This will allow the Prefs program to find the help file.")
  40.       (set #SelectHelpDir       "Select the directory where to copy online help.")
  41.       (set #CopyingHelp         "Copying online help...")
  42.       (set #SelectXPKDir        "Select the directory where to copy XPK libraries.")
  43.       (set #CopyingXPK          "Copying XPK libraries...")
  44.       (set #SelectCatalogDir    "Select the directory where to copy the catalog file.")
  45.       (set #CopyingCatalog      "Copying catalog file...")
  46.       (set #RunPrefProg         "Run the Pref program.")
  47.       (set #RunPrefHelp         "This will allow you to setup the ABackup Preferences.")
  48.     )
  49.   )
  50.   (if (= @language "français")
  51.     (
  52.       (set #InstallWhat         "Que voulez-vous installer ?")
  53.       (set #InstallChoice1      "Programme principal")
  54.       (set #InstallChoice2      "Programme de paramétrage")
  55.       (set #InstallChoice3      "Aide en ligne")
  56.       (set #InstallChoice4      "Bibliothèques XPK")
  57.       (set #InstallChoice5      "Catalogue")
  58.       (set #SelectMainDir       "Indiquez dans quel répertoire installer le programme principal.")
  59.       (set #CopyingMainProg     "Copie du programme principal...")
  60.       (set #SelectPrefDir       "Indiquez dans quel répertoire installer le programme de paramétrage.")
  61.       (set #BadPrefDir          "Désolé, le programme principal et le programme de paramétrage ne peuvent être installés dans le même répertoire !")
  62.       (set #CopyingPrefProg     "Copie du programme de paramétrage...")
  63.       (set #UpdateMainTT1       "Mise à jour du type d'outil %s du programme principal...")
  64.       (set #UpdateMainTT2       "N'oubliez pas de mettre à jour le type d'outil %s du programme principal.")
  65.       (set #UpdateMainTTH1      "Ceci permettra au programme principal d'appeller le programme de paramétrage.")
  66.       (set #UpdateMainTTH2      "Ceci permettra au programme principal de trouver le fichier d'aide.")
  67.       (set #UpdatePrefTT1       "Mise à jour du type d'outil %s du programme de paramétrage...")
  68.       (set #UpdatePrefTT2       "N'oubliez pas de mettre à jour le type d'outil %s du programme de paramétrage.")
  69.       (set #UpdatePrefTTH2      "Ceci permettra au programme de paramétrage de trouver le fichier d'aide.")
  70.       (set #SelectHelpDir       "Indiquez dans quel répertoire installer les fichiers d'aide.")
  71.       (set #CopyingHelp         "Copie des fichiers d'aide...")
  72.       (set #SelectXPKDir        "Indiquez dans quel répertoire installer les bibliothèques XPK.")
  73.       (set #CopyingXPK          "Copie des bibliothèques XPK...")
  74.       (set #SelectCatalogDir    "Indiquez dans quel répertoire installer le fichier catalogue.")
  75.       (set #CopyingCatalog      "Copie du fichier catalogue...")
  76.       (set #RunPrefProg         "Appel du programme de paramétrage.")
  77.       (set #RunPrefHelp         "Ceci vous permettra de paramétrer ABackup.")
  78.     )
  79.   )
  80.   (if (= @language "deutsch")
  81.     (
  82.       (set #InstallWhat         "Was möchten Sie installieren ?")
  83.       (set #InstallChoice1      "Hauptprogramm")
  84.       (set #InstallChoice2      "Voreinstellungsprogramm")
  85.       (set #InstallChoice3      "Online Hilfe")
  86.       (set #InstallChoice4      "XPK Libraries")
  87.       (set #InstallChoice5      "Katalog")
  88.       (set #SelectMainDir       "Wählen Sie das Verzeichnis für das Hauptprogramm.")
  89.       (set #CopyingMainProg     "Kopiere das Hauptprogramm...")
  90.       (set #SelectPrefDir       "Wählen Sie das Verzeichnis für das Voreinstellungsprogramm.")
  91.       (set #BadPrefDir          "Sorry, Hauptprogramm und Voreinstellungsprogramm dürfen nicht in das selbe Verzeichnis !")
  92.       (set #CopyingPrefProg     "Kopiere das Voreinstellungsprogramm...")
  93.       (set #UpdateMainTT1       "Aktualisiere das %s Merkmal des Hauptprogramms...")
  94.       (set #UpdateMainTT2       "Vergessen Sie nicht das %s Merkmal des Hauptprogramms zu aktualisieren.")
  95.       (set #UpdateMainTTH1      "Dies erlaubt dem Hauptprogramm den Aufruf des Voreinstellungsprogramms.")
  96.       (set #UpdateMainTTH2      "Dies erlaubt dem Hauptprogramm die Hilfe-Datei zu finden.")
  97.       (set #UpdatePrefTT1       "Aktualisiere das %s Merkmal des Voreinstellungsprogramms...")
  98.       (set #UpdatePrefTT2       "Vergessen Sie nicht das %s Merkmal des Voreinstellungsprogramms zu aktualisieren.")
  99.       (set #UpdatePrefTTH2      "Dies erlaubt dem Voreinstellungsprogramm die Hilfe-Datei zu finden.")
  100.       (set #SelectHelpDir       "Wählen Sie das Verzeichnis für die Online-Hilfe.")
  101.       (set #CopyingHelp         "Kopiere die Datei für die Online-Hilfe...")
  102.       (set #SelectXPKDir        "Wählen Sie das Verzeichnis für die XPK Libraries.")
  103.       (set #CopyingXPK          "Kopiere die XPK Libraries...")
  104.       (set #SelectCatalogDir    "Wählen Sie das Verzeichnis für die Katalogdatei.")
  105.       (set #CopyingCatalog      "Kopiere die Katalogdatei...")
  106.       (set #RunPrefProg         "Starte das Voreinstellungsprogramm.")
  107.       (set #RunPrefHelp         "Dies erlaubt Ihnen die Voreinstellungen von ABackup zu ändern.")
  108.     )
  109.   )
  110.   (if (= @language "italiano")
  111.     (
  112.       (set #InstallWhat         "Che cosa vuoi installare ?")
  113.       (set #InstallChoice1      "Programma Principale")
  114.       (set #InstallChoice2      "Programma Preferenze")
  115.       (set #InstallChoice3      "Aiuto in-linea")
  116.       (set #InstallChoice4      "Librerie XPK")
  117.       (set #InstallChoice5      "Catalogo Italiano")
  118.       (set #SelectMainDir       "Seleziona la directory dove copiare il Programma Principale.")
  119.       (set #CopyingMainProg     "Sto copiando il Programma Principale...")
  120.       (set #SelectPrefDir       "Seleziona la directory dove copiare il Programma Preferenze.")
  121.       (set #BadPrefDir          "Spiacente, ma il programma Principale e quello delle Preferenze non possono essere installati nella stessa directory !")
  122.       (set #CopyingPrefProg     "Sto copiando il programma per le Preferenze...")
  123.       (set #UpdateMainTT1       "Sto aggiornando il tooltype %s del programma Principale...")
  124.       (set #UpdateMainTT2       "Non dimenticare di aggiornare il tooltype %s del programma Principale.")
  125.       (set #UpdateMainTTH1      "Questo permetterà al programma Principale di chiamare il programma Preferenze.")
  126.       (set #UpdateMainTTH2      "Questo permetterà al programma Principale di trovare il file di aiuto.")
  127.       (set #UpdatePrefTT1       "Sto aggiornando il tooltype %s del programma Preferenze...")
  128.       (set #UpdatePrefTT2       "Non dimenticare di aggiornare il tooltype %s del programma Preferenze.")
  129.       (set #UpdatePrefTTH2      "Questo permetterà al programma Preferenze di trovare il file di aiuto.")
  130.       (set #SelectHelpDir       "Seleziona la directory dove copiare l'aiuto in-linea.")
  131.       (set #CopyingHelp         "Sto copiando aiuto in-linea...")
  132.       (set #SelectXPKDir        "Seleziona la directory dove copiare librerie XPK.")
  133.       (set #CopyingXPK          "Sto copiando librerie XPK...")
  134.       (set #SelectCatalogDir    "Seleziona la directory dove copiare il file catalogo.")
  135.       (set #CopyingCatalog      "Sto copiando il file catalogo...")
  136.       (set #RunPrefProg         "Eseguo il programma per le Preferenze.")
  137.       (set #RunPrefHelp         "Questo ti permette di impostare le Preferenze di ABackup.")
  138.     )
  139.   )
  140. ))
  141. ;
  142. ;********* Install the main program *******************************************
  143. ;
  144. (procedure InstallMainProg (
  145.   (set MainDir
  146.     (askdir
  147.       (prompt #SelectMainDir)
  148.       (help @askdir-help)
  149.       (default "SYS:Utilities")
  150.     )
  151.   )
  152.   (copyfiles
  153.     (prompt #CopyingMainprog)
  154.     (help @copyfiles-help)
  155.     (source (tackon SourceDir ProgName))
  156.     (dest MainDir)
  157.     (newname "ABackup")
  158.     (infos)
  159.   )
  160. ))
  161. ;
  162. ;********* Install the Prefs program *******************************************
  163. ;
  164. (procedure InstallPrefProg (
  165.   (set PrefDir MainDir)
  166.   (until (NOT (= PrefDir MainDir)) (
  167.     (set PrefDir
  168.       (askdir
  169.     (prompt #SelectPrefDir)
  170.     (help @askdir-help)
  171.     (default DefPrefDir)
  172.       )
  173.     )
  174.     (if (= PrefDir MainDir) (message #BadPrefDir))
  175.   ))
  176.   (copyfiles
  177.     (prompt #CopyingPrefprog)
  178.     (help @copyfiles-help)
  179.     (source (tackon SourceDir "Prefs/ABackup"))
  180.     (dest PrefDir)
  181.     (infos)
  182.   )
  183.   (if (NOT (= PrefDir DefPrefDir))
  184.     (if (BITAND ToInstall 1)
  185.       (tooltype
  186.     (prompt (#UpdateMainTT1 "PREFSPATH"))
  187.     (help #UpdateMainTTH1)
  188.     (dest (tackon MainDir "ABackup"))
  189.     (settooltype "PREFSPATH" PrefDir)
  190.     (confirm)
  191.       )
  192.       (message (cat (#UpdateMainTT2 "PREFSPATH") #UpdateMainTTH1))
  193.     )
  194.   )
  195. ))
  196. ;
  197. ;********* Install the help files **********************************************
  198. ;
  199. (procedure InstallHelp (
  200.   (set HelpDir
  201.     (askdir
  202.       (prompt #SelectHelpDir)
  203.       (help @askdir-help)
  204.       (default DefHelpDir)
  205.     )
  206.   )
  207.  
  208.   (if (= @language "français")
  209.       (set SrcHelpDir "français")
  210.       (set SrcHelpDir "english")
  211.   )
  212.  
  213.   (copyfiles
  214.     (prompt #CopyingHelp)
  215.     (help @copyfiles-help)
  216.     (source (tackon (tackon SourceDir (tackon "ABackup/Docs/" SrcHelpDir)) "ABackup.guide"))
  217.     (dest HelpDir)
  218.   )
  219.   (if (NOT (= HelpDir DefHelpDir))
  220.     (if (BITAND ToInstall 1)
  221.       (tooltype
  222.     (prompt (#UpdateMainTT1 "HELPPPATH"))
  223.     (help #UpdateMainTTH2)
  224.     (dest (tackon MainDir "ABackup"))
  225.     (settooltype "HELPPATH" HelpDir)
  226.     (confirm)
  227.       )
  228.       (message (cat (#UpdateMainTT2 "HELPPPATH") #UpdateMainTTH2))
  229.     )
  230.   )
  231.  
  232.   (copyfiles
  233.     (prompt #CopyingHelp)
  234.     (help @copyfiles-help)
  235.     (source (tackon (tackon SourceDir (tackon "Prefs/Docs/" SrcHelpDir)) "ABackupPrefs.guide"))
  236.     (dest HelpDir)
  237.   )
  238.   (if (NOT (= HelpDir DefHelpDir))
  239.     (if (BITAND ToInstall 2)
  240.       (tooltype
  241.     (prompt (#UpdatePrefTT1 "HELPPPATH"))
  242.     (help #UpdatePrefTTH2)
  243.     (dest (tackon PrefDir "ABackup"))
  244.     (settooltype "HELPPATH" HelpDir)
  245.     (confirm)
  246.       )
  247.       (message (cat (#UpdatePrefTT2 "HELPPPATH") #UpdatePrefTTH2))
  248.     )
  249.   )
  250. ))
  251. ;
  252. ;********* Install XPK library ************************************************
  253. ;
  254. (procedure InstallXPK (
  255.   (set XPKDir
  256.     (askdir
  257.       (prompt #SelectXPKDir)
  258.       (help @askdir-help)
  259.       (default "LIBS:")
  260.     )
  261.   )
  262.   (copylib
  263.     (prompt #CopyingXPK)
  264.     (help @copylib-help)
  265.     (source (tackon SourceDir "libs/xpkmaster.library"))
  266.     (dest XPKDir)
  267.   )
  268.   (foreach XPKSourceDir "#?.library"
  269.     (copylib
  270.       (prompt #CopyingXPK)
  271.       (help @copylib-help)
  272.       (source (tackon XPKSourceDir @each-name))
  273.       (dest (tackon XPKDir "compressors"))
  274.     )
  275.   )
  276. ))
  277. ;
  278. ;********* Install the catalogs ***********************************************
  279. ;
  280. (procedure InstallCatalog (
  281.   (set CatalogDir
  282.     (askdir
  283.       (prompt #SelectCatalogDir)
  284.       (help @askdir-help)
  285.       (default DefCatalogDir)
  286.     )
  287.   )
  288.   (copyfiles
  289.     (prompt #CopyingCatalog)
  290.     (help @copyfiles-help)
  291.     (source (tackon (tackon (tackon SourceDir "ABackup/Catalogs") @language) "abackup.catalog"))
  292.     (dest CatalogDir)
  293.   )
  294.   (copyfiles
  295.     (prompt #CopyingCatalog)
  296.     (help @copyfiles-help)
  297.     (source (tackon (tackon (tackon SourceDir "Prefs/Catalogs") @language) "abackupprefs.catalog"))
  298.     (dest CatalogDir)
  299.   )
  300. ))
  301. ;
  302. ;********* Start of the installation program **********************************
  303. ;
  304. (complete 0)
  305. (user 2)
  306. (set #InstallWhat "")
  307. ;
  308. ;********* Setup messages and check language
  309. ;
  310. (SetupMessages)
  311. (if (= #InstallWhat "")
  312.   (
  313.     (set langnum
  314.       (askchoice
  315.     (prompt "Which language do you speak ?")
  316.     (help @askoptions-help)
  317.     (choices "deutsch" "english" "français" "italiano")
  318.       )
  319.     )
  320.     (set @language (select langnum "deutsch" "english" "français" "italiano"))
  321.     (SetupMessages)
  322.   )
  323. )
  324. ;
  325. ;********* Displays the welcome message
  326. ;
  327. (user 0)
  328. (welcome)
  329. ;
  330. ;********* Ask which part is to be installed
  331. ;
  332. (set ToInstall
  333.   (askoptions
  334.     (prompt #InstallWhat)
  335.     (help @askoptions-help)
  336.     (if (= #InstallChoice5 "")
  337.     (choices #InstallChoice1 #InstallChoice2 #InstallChoice3 #InstallChoice4)
  338.     (choices #InstallChoice1 #InstallChoice2 #InstallChoice3 #InstallChoice4 #InstallChoice5)
  339.     )
  340.   )
  341. )
  342. ;
  343. ;******** Install each part
  344. ;
  345. (complete 15)
  346. (if (BITAND ToInstall  1)
  347.   (
  348.     (set ProgName "ABackup/ABackup")
  349.     (InstallMainProg)
  350.   )
  351. )
  352. (complete 30)
  353. (if (BITAND ToInstall  2) (InstallPrefProg))
  354. (complete 45)
  355. (if (BITAND ToInstall  4) (InstallHelp))
  356. (complete 60)
  357. (if (BITAND ToInstall  8) (InstallXPK))
  358. (complete 75)
  359. (if (BITAND ToInstall 16) (InstallCatalog))
  360. (complete 90)
  361. ;
  362. ;******** Call the Pref program
  363. ;
  364. (if (BITAND ToInstall  4)
  365.   (
  366.     (textfile
  367.       (dest TmpFile)
  368.       (append (cat "Run <NIL: >NIL: " (tackon PrefDir "ABackup")))
  369.     )
  370.     (execute
  371.       (TmpFile)
  372.       (prompt #RunPrefProg)
  373.       (help #RunPrefHelp)
  374.       (confirm)
  375.     )
  376.     (delete TmpFile)
  377.   )
  378. )
  379. ;
  380. ;******** End
  381. ;
  382. (if (= MainDir "")
  383.   (set @default-dest PrefDir)
  384.   (set @default-dest MainDir)
  385. )
  386. (complete 100)
  387. ;
  388.